import { apiRequest } from "../utils/request";
//根据key查询
export function configKey(configKey: string) {
  return apiRequest({
    url: `/infra/config/configKey/${configKey}`,
    method: "get",
  });
}
//创建会员开通订单
export function createOrder(data: any) {
  return apiRequest({
    url: `/pay/vipOrder/createOrder`,
    method: "post",
    data,
  });
}
//获取登录用户基本信息
export function getUserInfo() {
  return apiRequest({
    url: `/user/userInfo`,
    method: "get",
  });
}
//登录
export function loginByWxMa(data: any): Promise<commonTypes.ApiResponse<{ token: string; userId: string }>> {
  return apiRequest({
    url: `/user/loginByWxMa`,
    method: "POST",
    data,
  });
}

//获取订购记录（分页）
export function getVipRecord(data: any) {
  return apiRequest({
    url: `/member/vipRecord/list`,
    method: "get",
    data,
  });
}
//我的作品收藏列表（分页）
export function photographyLikeRecord(data: any) {
  return apiRequest({
    url: `/member/photographyLikeRecord/list`,
    method: "get",
    data,
  });
}
//我的好图收藏列表（分页）
export function pictureLikeRecord(data: any) {
  return apiRequest({
    url: `/member/pictureLikeRecord/list`,
    method: "get",
    data,
  });
}
//修改用户信息
export function userEdit(data: any) {
  return apiRequest({
    url: `/user/userEdit`,
    method: "post",
    data,
  });
}
//支付方式列表
export function payGroupList() {
  return apiRequest({
    url: `/pay/config/groupList`,
    method: "get",
  });
}
//AI漫画风异步结果
export function cartoonResult(data: any) {
  return apiRequest({
    url: `/external/photo/cartoonResult`,
    method: "get",
    data,
  });
}
//获取相片模版列表（分页）
export function getTemplateList(data: any) {
  return apiRequest({
    url: `/enjoy/photoTemplate/getTemplateList`,
    method: "get",
    data,
  });
}
